package com.ruoyi.shop.goods.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.goods.mapper.ShopGoodsAttrMapper;
import com.ruoyi.shop.goods.domain.ShopGoodsAttr;
import com.ruoyi.shop.goods.service.IShopGoodsAttrService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商品属性Service业务层处理
 * 
 * @author xuxiang
 * @date 2023-07-03
 */
@Service
public class ShopGoodsAttrServiceImpl implements IShopGoodsAttrService 
{
    @Autowired
    private ShopGoodsAttrMapper shopGoodsAttrMapper;

    /**
     * 查询商品属性
     * 
     * @param id 商品属性主键
     * @return 商品属性
     */
    @Override
    public ShopGoodsAttr selectGoodsAttrById(Long id)
    {
        return shopGoodsAttrMapper.selectGoodsAttrById(id);
    }

    /**
     * 查询商品属性列表
     * 
     * @param shopGoodsAttr 商品属性
     * @return 商品属性
     */
    @Override
    public List<ShopGoodsAttr> selectGoodsAttrList(ShopGoodsAttr shopGoodsAttr)
    {
        return shopGoodsAttrMapper.selectGoodsAttrList(shopGoodsAttr);
    }

    /**
     * 新增商品属性
     * 
     * @param shopGoodsAttr 商品属性
     * @return 结果
     */
    @Override
    public int insertGoodsAttr(ShopGoodsAttr shopGoodsAttr)
    {
        return shopGoodsAttrMapper.insertGoodsAttr(shopGoodsAttr);
    }
    
	/**
	 * 商品attr lists 集合
	 * 
	 * @param lists
	 * @return
	 */
	public int insertGoodsAttrList(List<ShopGoodsAttr> lists) {
		return shopGoodsAttrMapper.insertGoodsAttrList(lists);
	}

    /**
     * 修改商品属性
     * 
     * @param shopGoodsAttr 商品属性
     * @return 结果
     */
    @Override
    public int updateGoodsAttr(ShopGoodsAttr shopGoodsAttr)
    {
        return shopGoodsAttrMapper.updateGoodsAttr(shopGoodsAttr);
    }

    /**
     * 批量删除商品属性
     * 
     * @param ids 需要删除的商品属性主键
     * @return 结果
     */
    @Override
    public int deleteGoodsAttrByIds(String ids)
    {
        return shopGoodsAttrMapper.deleteGoodsAttrByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商品属性信息
     * 
     * @param id 商品属性主键
     * @return 结果
     */
    @Override
    public int deleteGoodsAttrById(Long id)
    {
        return shopGoodsAttrMapper.deleteGoodsAttrById(id);
    }
}
